<script setup>
import Content from '@/views/Content.vue'
import {useGlobalConf} from '@/utils/useGlobalConf'
import {dateLocale, locale} from '@/utils/useLocale'
import themeOverride, {theme} from '@/assets/themeOverride'
const {globalConf} = useGlobalConf()
watchEffect(() => {
  //向根dom元素动态添加主题属性
  document.documentElement.setAttribute('app-theme', globalConf.appTheme)
})
onBeforeMount(() => {
  //挂载前删除预览动画
  const LoadingEle = document.getElementById('loadingPage')
  if (LoadingEle != null) {
    LoadingEle.remove()
  }
})
</script>

<template>
  <!--全局配置 -->
  <n-config-provider
      class="el-cp-outside"
      :theme-overrides="themeOverride"
      :theme="theme"
      :locale="locale"
      :date-locale="dateLocale"
  >
    <!--挂载公共样式到body-->
    <n-global-style/>
    <!--挂载CSS变量-->
    <n-el class="el-outside">
      <!--信息提示框 Message-->
      <n-message-provider placement="bottom">
        <!--对话框 Dialog-->
        <n-dialog-provider>
          <!--内容主体-->
          <Content/>
        </n-dialog-provider>
      </n-message-provider>
    </n-el>
  </n-config-provider>
</template>

<style lang="less">
.el-cp-outside,
.el-outside,
.n-config-provider {
  height: 100%;
}

//end
</style>
